programming4us
           
 
 
Applications Server

BizTalk 2009 : Handling Failed Messages and Errors

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
8/20/2011 11:38:14 AM

1. Tracking and Message Management

Now that you have seen how BizTalk stores, routes, and publishes messages, the next step is to understand how those messages can be tracked and what happens to them once they have been processed. Each subscriber of a particular message references the same single copy of that message. This approach requires that a reference counter be kept for all messages flowing through the system. Although this minimizes storage, it requires that the messages be cleaned up once their reference counters reach 0. To accomplish this, the product includes a set of SQL Agent jobs that perform garbage collection for zero-reference-count messages and message parts. The stored procedures that handle garbage collection are as follows:

  • MessageBox_Message_Cleanup_BizTalkMsgBoxDb: Deletes all messages that have no references by any subscribers.

  • MessageBox_Parts_Cleanup_BizTalkMsgBoxDb: Deletes all messages that have no references by any messages.

  • PurgeSubscriptionsJob_BizTalkMsgBoxDb: Deletes unused subscription predicates leftover from system-created subscriptions.

  • MessageBox_DeadProcesses_Cleanup_BizTalkMsgBoxDb: Executed when the runtime detects that a server has crashed. This frees the work that the server was working on so another machine within the group can process it.

  • TrackedMessages_Copy_BizTalkMsgBoxDb: Copies tracked message bodies from the Messaging Engine spool tables into the tracking spool tables in the Messagebox database.

  • TrackingSpool_Cleanup_BizTalkMsgBoxDb: Removes the message body data from the database table to which the TrackedMessages_Copy_BizTalkMsgBoxDb SQL Server Agent job writes.

The first two items from the preceding list are used to keep garbage messages removed from the Messagebox. When executed, they search the messages and message parts within the Messagebox looking for messages with a reference count of zero. The stored procedures also check for parts that are not referenced by any messages and remove those as well. Once messages are ready to be removed, they are moved to the BizTalk Tracking Database. These two jobs are executed from the machine that hosts SQL Server. For these jobs to run, the SQL Server Agent needs to be running. If SQL Server Agent isn't running, tracked message bodies will never be offloaded to the Tracking Database, and hence the Messagebox will grow. As the database grows, performance will suffer, because the number of messages grows unchecked. This is because the Message Agent that is running within each BizTalk host will be calling a stored procedure that searches through each of the messages in the Messagebox looking for messages with matching subscription information.

To keep the Messagebox as empty as possible, the tracking subsystem will move completed messages to the Tracking Database on a periodic basis. This is accomplished by a BizTalk host that has been tagged as a "tracking" host by specifying an option in the Host Properties page. The Tracking Database is also where the MMC queries for data and displays its tracking information.

2. Handling Failed Messages and Errors

With BizTalk 2009 you have two options to get at suspended messages. The first option is to use MMC and process suspended messages manually. Although this is acceptable when you have to process only a few messages, this option can become very time- and labor-consuming if you have to deal with a large number of suspended messages. The second, and in most cases better, option is to automate the process using a set of context properties available to be subscribed on. Error handling context properties are defined within the http://schemas.microsoft.com/BizTalk/2005/error-report property schema. The new context properties are as follows:

  • Description

  • ErrorType

  • FailureCategory

  • FailureCode

  • InboundTransportLocation

  • MessageType

  • OutboundTransportLocation

  • ReceivePortName

  • RoutingFailureReportID

  • SendPortName

What needs to be done is to ensure that any receive ports that need to have error handling included have the Generate Error Report check box selected, as shown in Figure 1. This will signal the runtime engine to generate the routing failure message and publish it to the Messagebox. Since the message is published, there needs to be a subscription available to receive the routing failure message. To that end, you can create an orchestration that is direct-bound[] to the Messagebox through a receive port. The Receive shape in the orchestration will have a filter criteria specified that sets the subscription information so that it will receive all failed routing messages.

To implement the routing, the filter expression needs to be set to "ErrorReport.ErrorType == Failed Message," as shown in Figure 2.
Figure 1. Receive port configuration

Figure 2. Orchestration Receive shape filter

This will cause the subscription to be written that will receive all suspended messages. From here, once you have a copy of the failed message within the orchestration, you can send it wherever you need. An example would be to have the orchestration send the message to an e-mail address or to an offline database for examination. All these options will be quite easy to implement since the message has been parsed and routed to the orchestration. Note that if you enabled routing for failed messages, no suspended messages will show up in MMC, and therefore no manual processing options will be available. You have to design your automated error handling routine to be an adequate replacement of the functionality available in MMC.

Other -----------------
- Microsoft Dynamics GP 2010 : Dynamics GP Utilities (part 3) - Additional steps
- Microsoft Dynamics GP 2010 : Dynamics GP Utilities (part 2) - Loading sample company data & Creating a new Dynamics GP company
- Microsoft Dynamics GP 2010 : Dynamics GP Utilities (part 1) - Completing the Dynamics GP installation
- Microsoft Dynamics GP 2010 : Creating an ODBC data source
- Microsoft Dynamics AX 2009 : Working with Forms - Storing last form values
- Microsoft Dynamics AX 2009 : Creating modal forms & Changing common form appearance
- Exchange Server 2010 : Performing Tracking and Logging Activities in an Organization (part 2) - Using Protocol Logging & Using Connectivity Logging
- Exchange Server 2010 : Performing Tracking and Logging Activities in an Organization (part 1) - Using Message Tracking
- Exchange Server 2010 Maintenance, Monitoring, and Queuing : Understanding Troubleshooting Basics
- Extending Microsoft Dynamics CRM 4.0 : Examples
- Extending Microsoft Dynamics CRM 4.0 : IFrames
- BizTalk 2009 : Using XML Namespaces (part 3) - Using System Property Schemas
- BizTalk 2009 : Using XML Namespaces (part 2) - Using Port Filters and Content-Based Routing
- BizTalk 2009 : Using XML Namespaces (part 1) - Understanding Property Promotions
- BizTalk 2009 : Understanding the Message Bus
- Active Directory Domain Services 2008 : Determine Global Catalog Servers
- BizTalk Server 2006 Operations : Disaster Recovery
- Configuring and Using Active Directory Rights Management Services
- Microsoft Dynamics GP 2010 : Installing the Dynamics GP 2010 application
- Microsoft Dynamics GP 2010 : Installing Microsoft SQL Server for Dynamics GP
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us